<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:insert name="head" >
        <h:head>
            <title>BioDesk 1.0 #{userController.loggedUser.userLogin}</title>
            <h:outputStylesheet name="css/style.css" value="css/style.css"/>
               <h:outputScript library="js" name="biodesk.js" target="head" />
            <p:growl id="growl" showDetail="true" life="10000" autoUpdate="true"/>
            <h:form>
                <p:idleMonitor onidle="dlgSessionExpired.show()" timeout="300000" />

                <p:dialog draggable="false" resizable="false" modal="true"
                          closable="false" widgetVar="dlgSessionExpired"
                          width="400" height="250" header="Message">
                    <center>
                        <h:outputText value="Your session has been expired!!" /><br/>
                        <h:graphicImage url="/resources/images/syscon/exp_time.png"/>
                        <br/>
                        <p:commandButton ajax="false" value="Enter again" action="#{userController.logout}">
                            <f:setPropertyActionListener target="#{userController.loggedIn}" value="false"/>
                        </p:commandButton>
                    </center>
                </p:dialog>
                <p:dialog draggable="false" resizable="false" modal="true" rendered="#{userController.loggedUser == null}"
                          closable="false" widgetVar="dlgSessionExpired"
                          width="400" height="250" header="Message" visible="true">
                    <center>
                        <h:outputText value="Not Logged!" /><br/>
                        <h:graphicImage url="/resources/images/syscon/ops2.png"/>
                        <br/>
                        <p:commandButton ajax="false" value="Enter again" action="#{userController.logout}">
                            <f:setPropertyActionListener target="#{userController.loggedIn}" value="false"/>
                        </p:commandButton>
                    </center>
                </p:dialog>
            </h:form>
        </h:head>
    </ui:insert>
    <h:body  rendered="#{userController.loggedUser != null}" styleClass="customBG">
        <center>
            <div class="menu">
                <div class="foot">
                    <img src="resources/css/DNA_1.png"/>
                </div>
            </div>
            <ui:insert name="body" >
                <p:growl id="growl" showDetail="true" life="10000" autoUpdate="true"/>
            </ui:insert>
        </center>
    </h:body>
</html>
